function GravityMissile(){

	this.gameEngine = null;	
	this.parent = new GameObject();
	
	this.parent.collisionRadius = 5;
	
	//kwadrat - zeby nie trzeba bylo liczyc pierwiastkow
	this.maxMissileDistanceSQR = 100*100;
	this.currentMissileDistance = 0;
	this.missleVelocity = 10;	
	this.parent.mass = 100000;	
	
	this.parent.collisionDamage = 20;
	
	this.update = function(){
			this.parent.x+=this.parent.xVelocity;
			this.parent.y+=this.parent.yVelocity;
			if(this.currentMissileDistance >= this.maxMissileDistanceSQR){
				this.parent.toRemove = true;
			}
			else{				
				this.currentMissileDistance+=this.parent.xVelocity*this.parent.xVelocity + this.parent.yVelocity*this.parent.yVelocity;
			}
	}
	this.draw = function(){
		var ctx = this.gameEngine.canvasContext;		
		ctx.translate(this.parent.x,this.parent.y);
		ctx.rotate(this.parent.angle);
		
		ctx.strokeStyle="black";				
		ctx.beginPath();
		ctx.arc(0,0,this.parent.collisionRadius,0,2*Math.PI,true);		
		//ctx.strokeRect(-10,-20,30,50);
		ctx.stroke();
		ctx.closePath();			
	}
	this.init = function(){
		this.parent.xVelocity = this.missleVelocity * Math.cos(this.parent.angle);
		this.parent.yVelocity = this.missleVelocity * Math.sin(this.parent.angle);
	}
	this.parent.objectCollisionCallback = function(that,collisionObject){
		that.parent.toRemove = true;
	}
}